//
//  HubuFifthViewController.m
//  iHubu2
//
//  Created by hanshui on 12-10-31.
//  Copyright (c) 2012年 hanshui. All rights reserved.
//

#import "HubuFifthViewController.h"
#import "HelpCustomCell.h"

@interface HubuFifthViewController ()

@end

@implementation HubuFifthViewController
@synthesize helpTableView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    if( helpArray == nil) {
        helpArray = [[NSMutableArray alloc] initWithObjects:
                     [[NSArray alloc] initWithObjects:@"1", @"图书馆开馆闭馆时间", @"5月1日－9月30日：8:30－11:40 14:30－17:30；10月1日－4月30日：8:30－11:40 14:00－17:30（一般阅览室到22:00）", nil],
                     [[NSArray alloc] initWithObjects:@"2", @"移动终端图书馆主要功能", @"可以充分利用手机使用图书馆资源：查询馆藏数目；跨库检索图书、文献和杂志；查询图书；下载图书以及离线阅读等。", nil],
                     [[NSArray alloc] initWithObjects:@"3", @"图书馆读者公约", @"坚定正确的政治方向，尊重馆员的服务工作；爱护馆内的文献设备，遵守全馆的规章制度；勤奋刻苦的学习精神，安静整洁的秩序环境；互助合作的同志关系，文明礼貌的道德风尚。", nil],
                     [[NSArray alloc] initWithObjects:@"4", @"图书馆文明服务规范", @"树立“三心”意识：服务诚心，以诚心换理解；学习虚心，以虚心换支持；答疑耐心，以耐心换和谐。\n坚持“四个”一样：对群众与对干部一个样；对学生与对教师一个样；对生人与对熟人一个样；对馆外与对馆内一个样。\n禁止八种行为：守纪律必严格，禁迟到早退；集中精力干工作，禁闲聊看书报；服饰仪表须端庄，禁衣冠不整；上岗服务要亮牌，禁随便脱岗；接待热情且诚恳，禁简单粗暴；借还认真又熟练，禁敷衍对付；遇到冲突善忍耐，禁冲突争吵；爱护书刊讲原则，禁违规损坏。", nil],
                     [[NSArray alloc] initWithObjects:@"", @"技术支持：思蓝科技", @"", nil],
                     /*[[NSArray alloc] initWithObjects:@"1", @"", @"", nil],
                     [[NSArray alloc] initWithObjects:@"1", @"", @"", nil],
                     [[NSArray alloc] initWithObjects:@"1", @"", @"", nil],*/
                     nil];
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark -
#pragma mark Table View Data Source Methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [helpArray count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    /*
     static NSString *CellTableIdentifier = @"CellTableIdentifier";
     
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
     CellTableIdentifier];
     if (cell == nil) {
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
     reuseIdentifier: CellTableIdentifier] autorelease];
     }
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     cell.textLabel.font = [UIFont systemFontOfSize:18];
     cell.textLabel.textColor = [UIColor colorWithRed:0.2 green:0.4 blue:0.4 alpha:1.0];
     OPACBookObjects *opacItem = [bookObjectArray objectAtIndex:[indexPath row]];
     cell.textLabel.text = [opacItem.bookTitle stringByReplacingOccurrencesOfRegex:@"&#[0-9]{4};" withString:@" "];
     
     
     return cell;
     */
    static NSString *CellTableIdentifier = @"CellTableIdentifier1";
    HelpCustomCell *cell = (HelpCustomCell *)[tableView dequeueReusableCellWithIdentifier:
                                                            CellTableIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"HelpCustomCell" owner:self options:nil] objectAtIndex:0];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    NSArray *helpItem = [helpArray objectAtIndex:[indexPath row]];
    //cell.title.textColor = [UIColor colorWithRed:0.2 green:0.4 blue:0.4 alpha:1.0];
    cell.no.text = [helpItem objectAtIndex:0];
    cell.title.text = [helpItem objectAtIndex:1];
    cell.content.text = [helpItem objectAtIndex:2];
    
    return cell;
}

-(float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 77;
}
@end
